package com.example.musicdemo.adapter


import android.content.Context
import android.database.Cursor
import android.view.View
import android.view.ViewGroup
import androidx.cursoradapter.widget.CursorAdapter
import com.example.musicdemo.model.AudioBean
import com.example.musicdemo.widget.VBangItemView

class VBangAdapter(context: Context?, cursor: Cursor?) : CursorAdapter(context,cursor,0) {
    /**
     * 新建一个条目item
     */
    override fun newView(context: Context?, cursor: Cursor?, parent: ViewGroup?): View {
        return VBangItemView(context)
    }

    override fun bindView(view: View?, context: Context?, cursor: Cursor?) {
        val itemView = view as VBangItemView
        val itemBean = AudioBean.getAudioBean(cursor)
        itemView.setData(itemBean)
    }
}